<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML>
<html lang="zh-CN">
  <head>
    <base href="<%=basePath%>">
    
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    
    <title>图纸管理</title>
    
	<link href="lib/bootstrap-3.3.5/css/bootstrap.min.css" rel="stylesheet">
	<link href="lib/font-awesome-4.5.0/css/font-awesome.min.css" rel="stylesheet">
	
	<link href="designCloud/css/common.css" rel="stylesheet"></link>
	<link href="designCloud/css/console.css" rel="stylesheet"></link>
	
	<script src="lib/jquery/1.11.3/jquery.min.js"></script>
	<script src="lib/bootstrap-3.3.5/js/bootstrap.min.js"></script>
	
	<!--[if lt IE 9]>
      <script src="//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    
  </head>
  
  <body class="console-body">
  	<jsp:include page="console.jsp"></jsp:include>
  	
  	<div class="console-list">
  		<div class="console-listSolid">&nbsp;</div>
  		<div class="console-listContent">
	  		<div class="console-listHead clearfix">
				<form class="navbar-form navbar-left" role="search">
					<span class="dm-dropTitle">车型</span>
					<div class="dropdown dm-dropBtn">
					  <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
					    <span id="dropBtnContent">全部</span>  
					    <span class="caret"></span>
					  </button>
					  <ul id="dm-dropUl" class="dropdown-menu" aria-labelledby="dropdownMenu">
					  	<li><a href="javascript:;">全部</a></li>
					    <li><a href="javascript:;">8849</a></li>
					    <li><a href="javascript:;">ER30</a></li>
					  </ul>
					</div>
				
					<div class="form-group">
					 	<input type="text" class="form-control" placeholder="零件名称...">
					</div>
					<button type="submit" class="btn btn-default">搜索</button>
				</form>
				
				
	  		</div>
	  	
	  		<div class="console-listTable">
		  		<table class="table table-hover">
			      <thead>
			        <tr>
			          <th>零件号</th>
			          <th>零件名称</th>
			          <th>对应车型</th>
			          <th>图纸状态</th>
			          <th>操作</th>
			        </tr>
			      </thead>
			      
			      <tbody>
			        <tr>
			          <th scope="row">5305100-530-00</th>
			          <td>副仪表台本体</td>
			          <td>8849</td>
			          <td>
			          	<span class="state state-1"></span>
			          	<span class="state state-2"></span>
			          	<span class="state state-3"></span>
					  </td>
					   <td class="console-action">
			          	<a href="javascript:;" class="uploadDWG action-active">上传图纸</a>
			          	<a href="javascript:;">上架</a>
			          	<a href="javascript:;">下架</a>
			          </td>
			        </tr>
			        
			        <tr>
			          <th scope="row">5305100-530-00</th>
			          <td>副仪表台本体</td>
			          <td>8849</td>
			          <td>
			          	<span class="state state-1"></span>
			          	<span class="state state-2"></span>
			          	<span class="state state-3"></span>
					  </td>
					   <td class="console-action">
			          	<a href="javascript:;" class=" uploadDWG action-active">上传图纸</a>
			          	<a href="javascript:;">上架</a>
			          	<a href="javascript:;">下架</a>
			          </td>
			        </tr>
			      </tbody>
			    </table>
			    
				<nav class="clearfix">
					<ul class="pagination">
					  <li class="disabled"><a href="#" aria-label="Previous"><span aria-hidden="true">&laquo;</span></a></li>
					  <li class="active"><a href="#">1</a></li>
					  <li><a href="#">2</a></li>
					  <li><a href="#">3</a></li>
					  <li><a href="#">4</a></li>
					  <li><a href="#">5</a></li>
					  <li><a href="#" aria-label="Next"><span aria-hidden="true">&raquo;</span></a></li>
					</ul>
					
					<div class="console-listCount">
						<span>共 100 页</span> 到第 <input type="number" class="console-countInput"/> 页
						<span class="label label-primary">确定</span>
					</div>
				</nav>
		    </div>
  		</div>
  	</div><!-- console-list -->
  	
  	<!-- Modal -->
	<div class="modal fade dm-uploadModal" id="dm-uploadModal" tabindex="-1" role="dialog" aria-labelledby="dm-uploadModalLabel" data-backdrop="static">
	  <div class="modal-dialog" role="document">
	    <form action="">
		    <div class="modal-content">
		      <div class="modal-header">
		        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
		        <h4 class="modal-title" id="myModalLabel">上传相关图纸</h4>
		      </div>
		      
		      <div class="modal-body console-modalBody">
		        <div>
	        		<label>编程图</label>
					<div class="file-box">
						<input type="button" value="选择文件" class="file-input" onclick="flagFile.click()">
				        <input type="file" name="flagFile" style="display: none;" onchange="flagContent.value=value" >
						<input type="text" name="flagContent" style="display: none;" >
						
						<span class="file-name">未选择文件</span>
					</div>
					<input class="file-submit right" type="button" value="上传" onclick="">
		        </div>
		        <div>
	        		<label>产品制作图</label>
					<div class="file-box">
						<input type="button" value="选择文件" class="file-input" onclick="flagFile2.click()">
				        <input type="file" name="flagFile2" style="display: none;" onchange="flagContent2.value=value" >
						<input type="text" name="flagContent2" style="display: none;" >
						
						<span class="file-name">未选择文件</span>
					</div>
					<input class="file-submit right" type="button" value="上传" onclick="">
		        </div>
		        <div>
	        		<label>模具图</label>
					<div class="file-box">
						<input type="button" value="选择文件" class="file-input" onclick="flagFile3.click()">
				        <input type="file" name="flagFile3" style="display: none;" onchange="flagContent3.value=value" >
						<input type="text" name="flagContent3" style="display: none;" >
						
						<span class="file-name">未选择文件</span>
					</div>
					<input class="file-submit right" type="button" value="上传" onclick="">
		        </div>
		        
		        <div class="dm-modalHint">目前仅支持.stp格式文件上传</div>
		      </div>
		      
		      <div class="modal-footer">
		        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
		        <button type="submit" class="btn btn1">确定</button>
		      </div>
		    </div>
	     </form>
	  </div>
	</div>
  	
  	<script type="text/javascript">
  		$(document).ready(function(){
			carFilter(); //车型筛选
			uploadDWG();//上传图纸
		});
		
		function carFilter(){
			var dropBtnContent=$("#dropBtnContent");
			$("#dm-dropUl li").on("click",function(){
				var thisItem=$(this);
				var itemA=thisItem.find("a").text();
				dropBtnContent.text(itemA);
			});
		}
		
		function uploadDWG(){
			$(".uploadDWG").each(function(){
				var itemThis=$(this);
				itemThis.click(function(){
					$("#dm-uploadModal").modal('show');
				});
			});
		}
		
  	</script>
  </body>
</html>
